home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Viewers / aa_m68k_Intel_Only / ToyViewer1.2 / Source / hpcdtoppm.tproj / output.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-14  |  1.5 KB  |  75 lines

  1. /* hpcdtoppm (Hadmut's pcdtoppm) v0.6
  2. *  Copyright (c) 1992, 1993, 1994 by Hadmut Danisch (danisch@ira.uka.de).
  3. *  Permission to use and distribute this software and its
  4. *  documentation for noncommercial use and without fee is hereby granted,
  5. *  provided that the above copyright notice appear in all copies and that
  6. *  both that copyright notice and this permission notice appear in
  7. *  supporting documentation. It is not allowed to sell this software in 
  8. *  any way. This software is not public domain.
  9. */
  10.  
  11. #include "hpcdtoppm.h"
  12.  
  13.  
  14.  
  15. void writepicture(FILE *fout, sizeinfo *si, 
  16.                   implane *r,implane *g,implane *b)
  17.  {dim w,h;
  18.  
  19.   w=si->imhlen;
  20.   h=si->imvlen;
  21.  
  22.   melde("writepicture\n");
  23.      if((!r) || (r->iwidth != w ) || (r->iheight != h) || (!r->im)) error(E_INTERN);
  24.   
  25.      if((!g) || (g->iwidth != w ) || (g->iheight != h) || (!g->im)) error(E_INTERN);
  26.      if((!b) || (b->iwidth != w ) || (b->iheight != h) || (!b->im)) error(E_INTERN);
  27.  
  28.   write_ppm(fout,w,h,
  29.     r->im,r->mwidth,1, g->im,g->mwidth,1, b->im,b->mwidth,1);
  30.  }
  31.  
  32.  
  33.  
  34.  
  35. struct ph1 
  36.  {char  id1[8];
  37.   uBYTE ww1[14];
  38.   char  id2[20];
  39.   char  id3[4*16+4];
  40.   short ww2;
  41.   char  id4[20];
  42.   uBYTE ww3[2*16+1];
  43.   char  id5[4*16];
  44.   uBYTE idx[11*16];
  45.  } ;
  46.  
  47.  
  48. void druckeid(void)
  49. {struct ph1 *d;
  50.  char ss[100];
  51.  
  52.  d=(struct ph1 *)sbuffer;
  53.  
  54. #define dr(feld,kennung)   \
  55.      strncpy(ss,feld,sizeof(feld));\
  56.      ss[sizeof(feld)]=0;\
  57.      fprintf(stderr,"%s: %s \n",kennung,ss);
  58.  
  59.  
  60. dr(d->id1,"Id1")
  61. dr(d->id2,"Id2")
  62. dr(d->id3,"Id3")
  63. dr(d->id4,"Id4")
  64. dr(d->id5,"Id5")
  65.  
  66. #undef dr 
  67.  
  68. }
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.